<script setup>
defineProps(['goods'])
</script>

<template>
  <div class="items-center">
    <img v-img-lazy="goods.picture" :alt="goods.alt||''" />
    <div class="desc">
      <p class="title ellipsis">{{ goods.name ||goods.title }}</p>
      <span class="goods-price" v-if="goods.price">¥{{ goods.price }}</span>
    </div>
  </div>
</template>

<style scoped>
.items-center {
  display: flex;
  flex-direction: column;
  img {
    width: 100%;
    height: 100%;
    flex: 10;
  }
  .desc {
    margin-top: 5px;
    flex: 1;
    font-size: 16px;
    text-align: center;
    .goods-price {
      color: red;
    }
  }
}
</style>
